<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<?php
$this->addCssFile('/project/apps/ecga/styles/style.css');
$this->addCssFile('/project/apps/ecga/styles/datagrid.css');
$this->addCssFile('/project/apps/ecga/styles/product.css');

$this->addScriptFile('/statics/js/tooltips/tooltips.js');
$this->addScriptFile('/statics/js/datagrid/datagrid.js');
?>
<body>
    <?php $this->import('tips'); ?>
    <div class="action-header">
        <h3><?php $this->put('管理员分组列表');?></h3>
        <p class="action-desc"><?php $this->put('您可以在这里查看所有管理员分组，或者点击这里');?><a href="./mastergroup.php?a=add"><?php $this->put('添加管理员分组');?></a>。</p>
    </div>
    <div class="datagrid">
        <div class="gridbar nobg ">
            <div class="gridbar-left">
                <div class="form">
                    <select id="batchOptions">
                        <option value=""><?php $this->put('批量操作');?></option>
                        <option value="batchRemove" class="confirm:'<?php $this->put('您确定要删除选中项目吗?');?>'"><?php $this->put('删除');?></option>
                    </select>
                    <input type="button" id="batchBtn" class="button" value="<?php $this->put('确定');?>"/>
                </div>
             </div>
            <div class="pagelist-box">
                <div class="pagelist-box">
                <?php $this->htmlPageLinks($list, $uri) ?>
                </div>
            </div>
        </div>

    <!-- 快速编辑模板 -->
    <table id="inlineEditTable" class="inline-edit-form" style="display:none;"></table>

        <div style=" margin:0 20px; ">
            <table id="datagrid" class="datagrid-table" style="width:100%" border="0" cellspacing="0" cellpadding="0">
                <tr class="lock-th">
                    <th class="first" style="width:1%"><input type="checkbox"/></th>
                    <th class="wide"><?php $this->put('管理员分组');?></th>
                </tr>
        <?php if (!empty($list)): ?>
            <?php foreach ($list as $master): ?>
                <tr class="<?php $this->alternate();?>" recordid='<?php $this->put($master['id']);?>'>
                    <td class="first" ><input type="checkbox" name="id[]" value="<?php $this->put($master['id']);?>"/></td>
                    <td>
                        <p class="title row-masterName"><?php $this->put($master['groupName']);?></p>
                        <p class="actions hidden">
                            <?php if (1 != $master['id']):?>
                                <span><?php $this->txtLink('编辑', './mastergroup.php?a=edit&id=' . $master['id'], '', 'class="edit"');?></span>
                                <span><?php $this->txtLink('删除', './mastergroup.php?a=remove&id=' . $master['id'], '', 'class="remove"');?></span>
                            <?php endif;?>
                        </p>
                    </td>
                </tr>
            <?php endforeach; ?>
        <?php endif;?>
            </table>
            <?php $this->notFound($list) ?>
        </div>
        <div class="bottombar">
            <div class="gridbar-left">
                <span><?php $this->sprintf('共计 (%s) 条记录', $list->recordCount); ?></span>
                <span><?php $this->sprintf('显示 (%s - %s)', $list->start + 1, min($list->start + $list->pageSize , $list->recordCount)); ?></span>
            </div>
            <div class="pagelist-box">
                <?php $this->htmlPageLinks($list, $uri) ?>
            </div>
        </div>
    </div>
    <?php $this->import('footer'); ?>
<script type="text/javascript">
    window.addEvent('domready', function() {

        var dg = new DataGrid($("datagrid"), {
            "inlineEditTemplate": "inlineEditTable"
        });
    });
</script>
</body>
</html>
